﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using Wintellect.PowerCollections;


namespace PriorityQueue
{
    public class PriorityQueueClass<T>:IEnumerable<T>
    {
        private OrderedBag<T> orderedBag;
        public PriorityQueueClass()
        {
           orderedBag = new OrderedBag<T>();
        }

        public void Enqueue(T el)
        {
            orderedBag.Add(el);
        }

        public void Dequeue(T el)
        {
            orderedBag.Remove(el);
        }

        public int Count
        {
            get
            {
                return orderedBag.Count;
            }
        }
        IEnumerator<T> IEnumerable<T>.GetEnumerator()
        {
            for (int i = 0; i < Count; i++)
                yield return orderedBag[i];
        }

        IEnumerator IEnumerable.GetEnumerator()
        { return ((IEnumerable<int>)this).GetEnumerator(); }


    }

}
